use diesel::{Connection, MysqlConnection, r2d2};
use diesel::r2d2::{ConnectionManager, Pool};


pub fn build_pool(database_url:&str)->Pool<ConnectionManager<MysqlConnection>>{
    let manager=ConnectionManager::<MysqlConnection>::new(database_url);
    let pool=r2d2::Pool::builder()
        .build(manager)
        .expect("Failed to create pool");
    pool
}